package com.dtb.trade.service;

import com.dtb.trade.entity.PointDeal;

import java.util.List;

/**
 * @Author:ChengJian
 * @Description:
 * @Date: Created in 上午11:19 2018/8/21
 */
public interface BaseService<T> {

    //添加区块
    void addBlock(T t);

    //是否包含区块
    boolean isHaveBlock();

    //得到最新区块信息
    T getNewest();

    //根据索引号查询区块
    T getBlockByIndex(int index);

    //区块记账
    boolean hyperledger(T block, List<PointDeal> pointDeals);

    //生成新区块
    void tally(T block,List<PointDeal> pointDeals);

    //删除区块交易记录
    void deleteAllBlock();

    //验证区块过程中是否被篡改
    boolean prove();

    //查询当前索引号及以后的最新区块
    List<T> getCurrentBlocks(int index);


}
